package com.gxar.quick.ar.server.base.common.enums;

import java.util.Collections;
import java.util.HashMap;
import java.util.Map;

/**
 * @author nice
 * @version 1.0
 * @created 2023/11/15.
 */
public enum SketchfabCategoryEnum {

    AnimalsPets("animals-pets", "动物&宠物"),
    Architecture("architecture", "建筑"),
    ArtAbstract("art-abstract", "艺术&抽象"),
    CarsVehicles("cars-vehicles", "汽车&车辆"),
    CharactersCreatures("characters-creatures", "角色&生物"),
    CulturalHeritageHistory("cultural-heritage-history", "文化遗产&历史"),
    ElectronicsGadgets("electronics-gadgets", "电器&小装置"),
    FashionStyle("fashion-style", "时尚&风格"),

    FoodDrink("food-drink", "食品&饮料"),
    FurnitureHome("furniture-home", "家具&家庭"),

    Music("music", "音乐"),

    NaturePlants("nature-plants", "自然&植物"),
    NewsPolitics("news-politics", "新闻&政治"),

    People("people", "人物"),

    PlacesTravel("places-travel", "地点&旅行"),

    ScienceTechnology("science-technology", "科学&技术"),

    SportsFitness("sports-fitness", "运动&健康"),

    WeaponsMilitary("weapons-military", "武器&军事");
    private String code;
    private String message;

    SketchfabCategoryEnum(String code, String message) {
        this.code = code;
        this.message = message;
    }

    private static Map<String, SketchfabCategoryEnum> ENUM_MAP = new HashMap<>();
    private static Map<String, String> CODE_MAP = new HashMap<>();

    static {
        for (SketchfabCategoryEnum status : values()) {
            ENUM_MAP.put(status.getCode(), status);
            CODE_MAP.put(status.getCode(), status.getMessage());
        }
    }


    public static boolean contains(Integer code) {
        return CODE_MAP.containsKey(code);
    }

    public static SketchfabCategoryEnum getByCode(Integer code) {
        return ENUM_MAP.get(code);
    }

    public static Map<String, String> getCodeMap() {
        return Collections.unmodifiableMap(CODE_MAP);
    }

    public static Map<String, SketchfabCategoryEnum> getEnumMap() {
        return Collections.unmodifiableMap(ENUM_MAP);
    }

    public String getCode() {
        return this.code;
    }

    public String getMessage() {
        return this.message;
    }
}
